<%@ page language="java" contentType="text/html; charset=UTF-8"
  pageEncoding="UTF-8"%>
<%@include file="/common/taglibs.jsp"%>
<html>
<head>
<%@include file="/common/ec.jsp"%>
<%@include file="/common/extjs.jsp" %>
<%@include file="/common/meta.jsp"%>
<title>订单统计浏览</title>
</head>
<body>
<div class="x-panel">
<div class="x-panel-header">订单统计</div>
<div class="x-toolbar">
<table width="99%">
  <tr>
    <td><s:form action="stat.do" method="post">          
           下单日期：<input type="text" name="createBeginDate" style="width: 120px"
				value='<s:date name="createBeginDate" format="yyyy-MM-dd"/>'
				onfocus="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd'})"
				class="Wdate" />
						</>至
			<input type="text" name="createEndDate" style="width: 120px"
				value='<s:date name="createEndDate" format="yyyy-MM-dd"/>'
				onfocus="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd'})"
				class="Wdate" />
	<%--付款日期：<s:textfield name="model.payDate" size="8"></s:textfield> --%>
                  
           状          态：<s:select list="statusMap" name="model.status" headerKey="" headerValue="请选择"></s:select>     
      <input type="submit" value="统计" class="button" />
    </s:form>
    </td>
  </tr>
</table>
</div>
<div class="x-panel-body">
<div style="margin-left: -3px;" align="center">
<ec:table
  items="items" var="item" retrieveRowsCallback="limit" sortRowsCallback="limit" 
  action="stat.do" 
  useAjax="false"
  doPreload="false" 
  pageSizeList="10,20" 
  editable="false"
  sortable="true" 
  rowsDisplayed="10" 
  generateScript="true"
  resizeColWidth="false" 
  classic="false" 
  width="100%" 
  height="400px"
  minHeight="400"
  xlsFileName="统计报表.xls" 
  toolbarContent="navigation|pagejump|pagesize|refresh|export|extend|status">
  <ec:row>
    <ec:column width="40" property="_num" title="No." value="${GLOBALROWCOUNT}" sortable="false" style="text-align:center"/> 
    <ec:column width="150" property="_title" title="订单编号" sortable="false"  style="text-align:center"> 
  	   <a href="edit.do?model.id=${item.id}"><font color="blue">${item.sn}</font></a> 
    </ec:column> 
    <ec:column width="150" property="_title" title="图书"  sortable="false" style="text-align:center"> 
  	  	<c:forEach items="${item.items}" var="orderItem">
			<div style="width: 50px;height: 50px;">
				<a target="_blank"   	href="" 	name="productpic" title="">
  					<img src="${ctx}${orderItem.book.coverPhoto}"  style="width: 50px;height: 50px;" alt="22">
  				</a>
			</div>
		</c:forEach> 
    </ec:column>
    <ec:column width="130" property="user.name" title="下单人"  sortable="false" style="text-align:center"/>  
    <ec:column width="100" property="createDate"  title="下单日期"  sortable="false"  cell="date"  style="text-align:center">
    </ec:column>
    <ec:column width="100" property="payDate"  title="支付日期"  sortable="false" cell="date" style="text-align:center"/>
    <ec:column width="70" property="money" title="金额"   sortable="false" style="text-align:center"  />     
    <ec:column width="80" property="status" title="订单状态"  sortable="false" style="text-align:center">
       <c:choose>
         <c:when test="${item.status eq '0'}">
         	待审核
         </c:when>
         <c:when test="${item.status eq '1'}">
         	取消[系统]
         </c:when>
         <c:when test="${item.status eq '2'}">
         	确认[未付款]
         </c:when>
         <c:when test="${item.status eq '3'}">
         	已付款
         </c:when>
         <c:when test="${item.status eq '4'}">
         	已发货
         </c:when>
         <c:when test="${item.status eq '5'}">
         	结单
         </c:when>
         <c:when test="${item.status eq '6'}">
         	取消[用户]
         </c:when>
         <c:when test="${item.status eq '7'}">
         	系统删除
         </c:when>
       </c:choose>
    </ec:column>    
		    
    <ec:column width="180" property="_0" title="操作" style="text-align:center" sortable="false">
    <a href="edit.do?model.id=${item.id}"><font color="blue">查看</font></a>	       	        
	</ec:column>    
  </ec:row>
</ec:table>
	<div style="margin-top: 20px; padding-left: 60px; text-align: left; font-size: 16px;">
		订单数：${count } 总金额：${total }
	</div>

</div>
</div>
</div>
</body>
</html>